﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using LED.DataBase;

namespace LED.Definition
{
    /// <summary>
    /// Interaction logic for LED.xaml
    /// </summary>
    public partial class LEDMaster : UserControl
    {
        /*
         1.建立点矩阵
         2.默认都是暗
         3.点亮则是1
         4. 根据模板生成区域
         5.添加一个帧
         6. 指定区域的内容类型
         7.添加区域内容
         * 
         */
        LEDDataSet setUI
        {
            get
            {
                return (LEDDataSet)this.FindResource("lEDDataSet");
            }
        }
        CollectionViewSource vwLEDLIST
        {
            get
            {
                return (CollectionViewSource)this.FindResource("vwLEDLIST");
            }
        }
        CollectionViewSource vwMASTER
        {
            get
            {
                return (CollectionViewSource)this.FindResource("vwMASTER");
            }
        }
        CollectionViewSource vwLEDLOCATION
        {
            get
            {
                return (CollectionViewSource)this.FindResource("vwLEDLOCATION");
            }
        }
        public LEDMaster()
        {
            InitializeComponent(); 
            
        }

        private void cmdSaveMaster_Click(object sender, RoutedEventArgs e)
        {

        }

        private void UserControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (vwMASTER != null)
            {
                if (vwMASTER.View != null)
                {
                    vwMASTER.View.MoveCurrentToFirst();
                }
            }

        }
    }
}
